package com.hbt.mycloud_consumer.consumer;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MyServiceFallBack implements FallbackFactory<MyService> {

    @Override
    public MyService create(Throwable throwable) {
        return new MyService() {
            @Override
            public String login() {
                System.out.println("进入登录接口繁忙fallback");
                return "登录接口繁忙*****";
            }

            @Override
            public String register() {
                System.out.println("进入注册接口繁忙fallback");
                return "注册接口繁忙***";
            }
        };
    }
}
